import java.util.Scanner;

public class text_3 {
    public static void main(String[] args) {
        int grade = 12;
        if (grade > 14) {
            System.out.println("今天吃牛肉");
        } else {
            System.out.println("吃子弹去吧");
        }

        System.out.println("====================");
        System.out.println("判断闰年");//能被4整除却不能被100整除
        int year = 2000;
        if (year % 400 == 0) {
            System.out.println("世纪闰年");
        } else if (year % 4 == 0 && year % 100 != 0) {
            System.out.println("是闰年");
        } else {
            System.out.println("不是闰年");
        }

        System.out.println("=====================");
        System.out.println("switch");//注意：基本数据类型不能使用float，double boolean,long
        int a = 3;
        switch (a) {
            case 3:
            case 4:
            case 5:
                System.out.println("春天");
                break;
            case 6:
            case 7:
            case 8:
                System.out.println("夏天");
                break;
            case 9:
            case 10:
            case 11:
                System.out.println("秋天");
                break;
            case 12:
            case 1:
            case 2:
                System.out.println("冬天");
                break;
        }
        System.out.println("========循环===========");
        System.out.println("while");
        System.out.println("1!+2!+3！+4!");
        int n =1;
        int num = 0;
        while(n<=4){
            int i =1;
            int num1 = 1;
            while(i<=n){
                num1 = num1*i;
                i++;
            }
            num = num+num1;
            n++;
        }
        System.out.println(num);
        System.out.println("===========");
        int i = 100;
        while(i<=200){
            if( i%3!=0 || i%4!=0){
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }

        a= 0;
        do{
            System.out.println(a);
        }while(a!=0);

        Scanner scanner =new Scanner(System.in);
    /*    System.out.println("请输入你的姓名");
        String name  = scanner.nextLine();
        System.out.println("姓名："+name);
        System.out.println("请输入你的年龄");
        int age  = scanner.nextInt();
        System.out.println("年龄："+age);
       // scanner.nextLine();//因为输入年龄后有一个回车，程序会认为你输入了一个回车当作姓名
        System.out.println("请输入你的工资");
        String salary = scanner.nextLine();
        System.out.println("工资："+salary);
       scanner.close();//认为是一种资源用完要关闭*/


        //输入多组数据，结束使用ctrl+d
        while(scanner.hasNextLine()){
            String string  = scanner.nextLine();
            System.out.println(string);
        }
    }
}
